<script type="text/javascript">
    $(document).ready(function(){
        
        $('.button').click(function(){
            if(trim($('#prideImg').val())=='')
            {
                alert('กรุณาเลือกรูปภาพ');
            }
            else if(trim($('#prideMsg').val())=='')
            {
                alert('กรุณากรอกข้อความ');
            }
            else
            {
                $('#prideStudentAddFrm').submit();
            }
        });
        
    });
    
</script>
<form name="prideStudentAddFrm" id="prideStudentAddFrm" target="ajaxIfrm" method="post" action='function/personnelsAdd.php' enctype='multipart/form-data'>
    <p id="prideStudentAddFrmImg">
        <label>Image : </label>
        <input type="file" name="prideImg" id="prideImg" />
    </p>
    <p id="prideStudentAddFrmMsg">
        <label>Message : </label>
        <textarea name="prideMsg" id="prideMsg" cols="50" rows="2" class="styled_textarea wysiwyg"></textarea>
    </p>
    <p id="prideStudentAddFrmMsg">
        <input type="radio" name="prideActive" value="1" checked="checked"/> Show
        &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="prideActive" value="2" /> Hide
    </p>
    <input type="button" class="button" value="Save" />
    &nbsp;<img src="images/ajax-loader.gif" class="ajax_load_img submit_indicator"/>
</form>
<div class="information canhide png_bg">รูปภาพขนาดแนะนำคือ 255x165 pixel</div>
<div class="fail canhide png_bg ajax_msg" id="error_msg"></div>
<div class="success canhide ajax_msg" id="success_msg"><p></p></div>
<iframe name="ajaxIfrm" class="ajaxIfrm" style="" ></iframe>